home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / c.dxr / 00014_Curved Line.ls < prev    next >
Encoding:
Text File  |  1996-02-15  |  1.8 KB  |  43 lines

  1. on drawCurvedline OrbitObjSpriteNum, startpoint, endPoint, mySeasonsAnim
  2.   set epicenter to (startpoint + endPoint) * 0.5
  3.   set Xr to abs(getAt((startpoint - endPoint) / 2, 2))
  4.   set Yr to 80
  5.   set howmany to 15
  6.   repeat with thisUpdate = 1 to howmany
  7.     set percentDone to thisUpdate / (howmany + 0.0)
  8.     set startPointA to startpoint * (1.00009999999999999 - percentDone)
  9.     set endPointA to endPoint * percentDone
  10.     set relativeCenter to startPointA + endPointA
  11.     set radians to thisUpdate / (howmany + 0.0) * 2.0
  12.     set XpercentOffset to 0
  13.     set YpercentOffset to sin(PI / 2.0 * radians)
  14.     if thisUpdate = 7 then
  15.       set PuppetFlag to 1
  16.       set the loc of sprite getaProp(getaProp(gObjects, #slotTop), #SpriteNum) to getaProp(getaProp(gObjects, #slotTop), #onloc)
  17.       set mySeasonsAnim to 17
  18.       set the castNum of sprite mySeasonsAnim to the castNum of sprite getaProp(getaProp(gObjects, #SeasonsAnim), #SpriteNum)
  19.       set the loc of sprite mySeasonsAnim to getaProp(getaProp(gObjects, #SeasonsAnim), #loc)
  20.       set the ink of sprite mySeasonsAnim to 0
  21.       updateStage()
  22.     end if
  23.     set Xloc to getAt(relativeCenter, 1) - (XpercentOffset * Xr)
  24.     set Yloc to getAt(relativeCenter, 2) + (YpercentOffset * Yr)
  25.     set the loc of sprite OrbitObjSpriteNum to point(Xloc, Yloc)
  26.     updateStage()
  27.   end repeat
  28. end
  29.  
  30. on drawLine OrbitObjSpriteNum, startpoint, endPoint
  31.   set howmany to 10
  32.   repeat with thisUpdate = 1 to howmany
  33.     set percentDone to thisUpdate / (howmany + 0.0)
  34.     set startPointA to startpoint * (1.00009999999999999 - percentDone)
  35.     set endPointA to endPoint * percentDone
  36.     set relativeCenter to startPointA + endPointA
  37.     set Yloc to getAt(relativeCenter, 2)
  38.     set Xloc to getAt(relativeCenter, 1)
  39.     set the loc of sprite OrbitObjSpriteNum to point(Xloc, Yloc)
  40.     updateStage()
  41.   end repeat
  42. end
  43.